package buildinjava;

/**
 * Facilitates implementing Configuration.
 *
 * @author Gili Tzabari
 */
public abstract class AbstractConfiguration implements Configuration
{
	private final String name;

	/**
	 * Creates a new AbstractConfiguration
	 *
	 * @param name the configuration name
	 */
	protected AbstractConfiguration(String name)
	{
		this.name = name;
	}

	@Override
	public String getName()
	{
		return name;
	}

	@Override
	public boolean equals(Object o)
	{
		if (!(o instanceof Configuration))
			return false;
		Configuration other = (Configuration) o;
		return name.equals(other.getName());
	}

	@Override
	public int hashCode()
	{
		return name.hashCode();
	}
}
